interface UserInfo {
    readonly name:string;
    age:number;
    sex?:number;
    add: (name: string, age: number) => boolean;
    // [propName:string]:any
  }
  // 函数使用
  function createUser(userinfo:UserInfo){}
  
  // 变量使用
  let user:UserInfo = {name:'张三', age:19, add(name:string, age: number) {return true}}